<!DOCTYPE html>
<html lang="pt-br">
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        require ("../../_app/Config.inc.php");
        
        $cadAni = new Cadastrar();
        $dataCadastroAni = filter_input_array(INPUT_POST,FILTER_DEFAULT);
        if(!empty($dataCadastroAni['CadastrarAni'])):
            $cadAni->CadastrarAnimal($dataCadastroAni);
        endif;
        ?>
        
        <fieldset>
            <form name="CadastrarAnimal" action="" method="POST" >
                <label>CPF Cliente:</label><br />
                <select name="clientes">
                    <option value="">Selecione o CPF</option>
                    <?php 
                        $list = new Read();
                        $list->ExeRead('clientes');
                        if($list->getResult()>= 1):
                            foreach ($list->getResult() as $lista):
                                echo "<option value=\"{$lista['CPF_Cli']}\">&raquo;&raquo {$lista['CPF_Cli']} </option>";
                        endforeach;
                        endif;
                    ?>
                </select><br />
                <label>Raça Animal:</label><br />
                <input type="text" name="raca" /><br />
                <label>Peso:</label><br />
                <input type="text" name="peso" /><br />
                <label>Cor do Pelo:</label><br />
                <input type="text" name="CorPelo" /><br />
                <label>Id Cliente:</label><br />
                    
                <?php
                    echo "<input type=\"text\" name=\"idCli\" value=\"{$lista['id_Cli']}\"  /><br />";
                    echo "<label>CPF Cliente:</label><br />";
                    echo "<input type=\"text\" name=\"cpfCli\" value=\"{$lista['CPF_Cli']}\"   /><br />";
                ?>
                <input type="submit" name="CadastrarAni" value="Cadastrar" />
                
            </form>
        </fieldset>
        
    </body>
</html>